package com.platform.hjt.sys.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * SysLoginLog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_login_log")
public class SysLoginLog implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -8613988868248445497L;
	private String loginLogId;
	private SysUserInfo sysUserInfo;
	private Timestamp loginTime;
	private String loginIp;

	// Constructors

	/** default constructor */
	public SysLoginLog() {
	}

	/** minimal constructor */
	public SysLoginLog(String loginLogId) {
		this.loginLogId = loginLogId;
	}

	public SysLoginLog(SysUserInfo sysUserInfo,
			Timestamp loginTime, String loginIp) {
		this.sysUserInfo = sysUserInfo;
		this.loginTime = loginTime;
		this.loginIp = loginIp;
	}

	
	/** full constructor */
	public SysLoginLog(String loginLogId, SysUserInfo sysUserInfo,
			Timestamp loginTime, String loginIp) {
		this.loginLogId = loginLogId;
		this.sysUserInfo = sysUserInfo;
		this.loginTime = loginTime;
		this.loginIp = loginIp;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	@Column(name = "login_log_id", unique = true, nullable = false, length = 32)
	public String getLoginLogId() {
		return this.loginLogId;
	}

	public void setLoginLogId(String loginLogId) {
		this.loginLogId = loginLogId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_user_info_id")
	public SysUserInfo getSysUserInfo() {
		return this.sysUserInfo;
	}

	public void setSysUserInfo(SysUserInfo sysUserInfo) {
		this.sysUserInfo = sysUserInfo;
	}

	@Column(name = "login_time", length = 19)
	public Timestamp getLoginTime() {
		return this.loginTime;
	}

	public void setLoginTime(Timestamp loginTime) {
		this.loginTime = loginTime;
	}

	@Column(name = "login_ip", length = 50)
	public String getLoginIp() {
		return this.loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

}